package com.yaowk.sfp.system.server.entity;

import com.yaowk.sfp.common.db.BaseEntity;
import com.yaowk.sfp.common.db.GeneratorNote;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import java.util.Set;

@Getter
@Setter
@ToString
@Entity
public class SysResource extends BaseEntity<Long> {

    @GeneratorNote("请求方法 GET,POST,PUT,DELETE")
    @Column(nullable = false)
    private String method;
    @GeneratorNote("资源路径")
    @Column(nullable = false)
    private String resource;
    @GeneratorNote("名称")
    private String name;

    @ManyToMany(mappedBy = "resources")
    private Set<SysMenu> menus;
}
